<?php
/**
 * Description of Controller
 *
 * @author Gowork
 */
class Application_Component_Controller extends Zend_Controller_Action {
            
    /**
     * Sprawadza który szablon wczytać z komponentów czy docelowy
     * @return Zend_View
     */
    public function scriptInherit() {        
        $pathView =  array_reverse($this->view->getScriptPaths()); 
        $scriptName = $this->getViewScript();
        
        foreach($pathView as $path) {
            
            if(file_exists($path.$scriptName)) {                    
                $this->view->setBasePath(str_replace('scripts','',$path));
                break;
            } 
            
        }
        
        return $this->view;
    }
    
}

?>
